package com.whats.indicator.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.whats.indicator.entity.PdTransformer;
import com.whats.indicator.entity.req.TransformerEnergyEffcyReq;
import com.whats.indicator.mapper.PdTransformerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class PdTransformerService extends ServiceImpl<PdTransformerMapper, PdTransformer> {

    @Autowired
    private PdTransformerMapper pdTransformerMapper;



    public IPage<PdTransformer> getPdTransformerPageList(TransformerEnergyEffcyReq transformerEnergyEffcyReq) {
        IPage<PdTransformer> page = new Page<>(transformerEnergyEffcyReq.getCurrent(), transformerEnergyEffcyReq.getSize());
        QueryWrapper<PdTransformer> queryWrapper = new QueryWrapper<>();

        queryWrapper.orderByDesc("name");
        return this.page(page, queryWrapper);
    }
}
